![]() |
![]() |
|---|---|
![]() |
![]() |
Currently supported filetypes: stl, glb, obj (and mtl), fbx, 3mf
This plugin allows you to showcase all sorts of 3D models in your vault and notes using the infamous three.js library. As opposed to other plugins this plugin allows you to embed your 3D models locally. This means you won't have to upload your models to some other website and embed that in your note, but rather just have the file in your vault and the plugin does all the other work for you.
This plugin also allows you to make your scene with the whole model look as nice as possible. Influencing a lot of variables such as background colors, autorotation, lighting, scales, etc. [Look at the documentation below for all the options]
Note
Developer Note!: If the plugin misses anything, feel free to open a github issue or tag me in the obsidian discord @jesse5. I am very open to suggestions and bugfixes and love hearing them :)
Tip
If you like my plugin feel free to leave a star on my repository (it's like a reward)
Go to the settings tab of obsidian -> 'Files and Links' -> toggle the 'Detect all file extensions'
This allows you to see every type of file in your obsidian vault, including 3D model files such as stl.
Untitled.video.5.mp4
![]() |
![]() |
|---|---|
3. On line with embed execute the embed 3D command (ctrl+p) -> Embed 3D: Single Scene: Add a 3D embed at cursor position |
4. Voila a 3D model |
Version 1.1.0 also allows you to include grids of 3D models in your vault if you wanna showcase multiple models or perspectives at once
![]() |
![]() |
|---|---|
| Video of getting a grid | possible view of a grid |
To get the grid, similarly to the instructions above, drag in all the models you want. Select all the models with a drag selection, and execute the grid command: (ctrl+p) -> Embed 3D: Grid: Add a 3D grid embed from selection.
Each embed will contain a codeblock of information. You can access this by clicking in the top right of the scene OR by moving your type cursor into the codeblock
![]() |
![]() |
|---|---|
| where to click to get to the codeblock | view of a codeblock |
This codeblock will allow you to modify A LOT of settings for this block only. If you want settings to be generally applied to all scenes you embed you should go to the settings tab.
A codeblock should minimally contain these values per scene:
"models": [
{"name": "Airship.glb", "scale": 0.7, "position": [0, 0, 0], "rotation": [0, 0, 0]}
],
"camera": {
"orthographic": false,
"camPosXYZ": [0,5,10], "LookatXYZ": [0,0,0]
},
"lights": [
{"type": "directional", "color": "FFFFFF", "pos": [5,10,5], "target": [0,0,0], "strength": 1, "show": false},
{"type": "ambient", "color": "FFFFFF", "pos": [0,0,0], "strength": 0.5, "show": false}
]Important
The last line of the codeblock should not end on a comma, all other lines should (The codeblock uses JSON structure)
Or in case of a grid:
```3D-grid
"gridSettings": {},
"cell1": {}, //...standard minimum config. See above codeblock
"cell2": {}
```But this is just the tip of the iceberg! The codeblock can receive a lot more variables to modify the scene and give you more control.
Look at the codeblock to alter minor things in the scene. It shows all the config options of a 3D scene for now.
Beside the basic configuration, these are lines you can add for more control:
This will come preloaded when entering the command, but this config allows you to change elements about the model(s). You can add multiple models in this array to render multiple models in one scene at the same time.
"models": [
{"name": "Airship.glb", "scale": 0.7, "position": [0, 0, 0], "rotation": [0, 0, 0]}
],nameis the name of the file of the 3D model in your vaultscaleis the scale of the object related to your export sizepositionallows you to change the position of the model in the scenerotationallows you to change the rotation of the model in the scene
To change the width or height, or the css alignment of a block:
"renderBlock": {
"widthPercentage": 100,
"height": 300,
"alignment": "center"
}widthPercentagegoes from 1 - 100heightis in pixelsalignmenthas 3 options (begin, center, end)
When using a grid, instead of using Render Block Settings you can use the config below:
"gridSettings": {
"columns": 4,
"rowHeight": 200,
"gapX": 10,
"gapY": 10
},columnsstates how many columns your grid hasrowHeightcan either be a number, or a string"auto". Auto makes an automatic square, while a number dictates the height of one row in pixelsgapXandgapYdictate the gapsize between scenes in your grid in pixels
To change some other scene settings:
"scene": {
"showGuiOverlay": false,
"autoRotation": [0, 0, 0],
"backgroundColor": "4bb8dd",
"showGroundShadows": true,
"orbitControlDamping": true,
"showAxisHelper": false, "length": 5,
"showGridHelper": false, "gridSize": 10
},showGuiOverlayprovides you with a gui (see further down)autoRotationrotates your model automatically on any axisbackgroundColorcan also be set totransparentor any hexvalue for a color.showGroundShadowsplaces a plane in the scene with a shadow material (Transparent but shows shadows)orbitControlDampingcan be toggled for smoother orbit controlsshowAxisHelperandshowGridHelpershow scene helpers such as a grid or the main axis.
If you want to utilize HDR loading in your scenes, for very realistic lighting and reflections you can do so. It is important to mention that this will cause your vault, or specifically note, to load more slowly since it has to load the HDR image, which can be quite big in size.
You can add this inside the scene tag as seen above:
"hdriBackground": {
"texturePath": "filename.hdr",
"sceneBackground": true,
"baseGeometry": true
}texturePathis the filename of the HDRI. (You dont have to include the vault path, filename suffices)sceneBackgroundputs the HDR texture you provide as the scene backgroundbaseGeometryloads a torus with very metallic material so you can see how well your HDRI works
Example of HDRI with a base Geometry:

Specifically for stl model files, I added some additional configuration
"stl": {
"stlColorHexString": "ff0000",
"stlWireframe":false
},stlColorHexStringallows you to set the color of an stl model itselfstlWireframeallows you to show the stl as a wireframe
It's usefull to know that the plugin supports obj models, and thereby the accomponying .mtl files. For them to work, the mtl file has to have the exact same name as the obj file (most 3D programs export them with the same name by default) and they need to be in the same folder.
Lighting settings such as type, color, position, strength and whether you can see a sphere at the location of the light
"lights": [
{"type": "directional", "color": "FFFFFF", "pos": [5,10,5], "target": [0,0,0], "strength": 1, "castShadows": true, "show": false},
{"type": "ambient", "color": "FFFFFF", "pos": [0,0,0], "strength": 0.5, "show": false},
{"type": "attachToCam", "color": "ffffff", "pos": [5,10,5], "strength": 1, "show": false},
{"type": "point", "color": "ffffff", "pos": [5,10,5], "strength": 1, "castShadows": true, "show": false},
{"type": "spot", "color": "ffffff", "pos": [5,10,5], "target": [0,0,0], "distance": 0, "angle": 0, "strength": 1, "castShadows": true, "show": false},
{"type": "hemisphere", "skyColor": "ffffff", "groundColor": "FFFFFF", "strength": 1, "show": false}
],typehas 6 optionsdirectional, ambient, attachToCam, point, spot, hemisphere(each of them can be found in the three.js documentation if you want to read more. Except forattachToCamwhich just attaches a lightsource to the camera)colorallows you to set a hexvalue for the color of the lightpositionallows you to set the position of the lightsourcestrengthallows you to set the strength of the lightsourceshowallows you to physically see the lightsource position by placing a sphere at the position coordinates you provide (can be usefull for setting up your scene)castShadowsonly available in thedirectional, pointandspotlightsource, which enables the lightsource to cast shadowstargetonly available in thedirectionalandspotlightsource, to aim it at a pointdistanceonly available in thespotlightsource, allows you to say how far the light projectsangleonly available in thespotlightsource, allows you to adjust the angle of the spotlightskycolorandgroundColorare part of thehemispherelightsource, for a color transition. (look at three.js documentation for more details)
To change camera settings:
"camera": {
"orthographic": false,
"camPosXYZ": [0,5,10], "LookatXYZ": [0,0,0]
},orthographicallows you to switch between a perspective and orthographic cameracamPosXYZallows you to set the camera positionLookatXYZallows you to aim the camera at a specific point
Now working with a codeblock might be a tad annoying to finetune your models. So I've been working on a GUI that allows you to change some of the parameters with more ease. By changing this option in your config of the scene to true
"scene": {
"showGuiOverlay": false | true,
},You can use transform controls and color pickers to finetune your scene a bit better. See the images below, you have a color picker (becomes unavailable when your background color is set to transparent), a rotation tool, a position tool and moving the camera. When clicking the checkmark, the scene will be saved as is in the config. But you can also reset it if you mess up somehow.

Use the settings tab, to alter standard settings for how all the models are initially loaded. The settings tab has the same options as the codeblock above, but are global settings, the codeblock for each model will override the global setting if they are different. But the codeblocks initial values will be filled according to the global settings. Such as background color, size of 3D embed, or scale of the model.

- The plugin uses three.js, thereby the amount of active renderers (webGL contexts) is limited to 16. This means that you can either have 16 single scenes shown at once, or 16 grids at the same time (grids only use one renderer if the advanced scissor option is togled on). a. It seems that on mobile scissoring is not possible, and the amount of active renderers is limited to 8 at once.
- Big models will be laggy (defined by vertex count), since obsidian has a limited amount of RAM that cannot be altered. If you have a big model in a note, and that note is open, your whole vault may lag. Be aware of this. Most light models cause no issue.
- If your model is not showing up in the scene, half of the time the scale of the model is the cause, so try playing around with sizes both large and small.
- Be able to run custom three.js script for a scene.
- Camera Path Animations
- More intuitive GUI for editing scenes (Modal)
If you are enjoying 3D embed, then feel free to support my work and enthusiasm by buying me a coffee on: Buy me a coffee
- I have both an .obj file and .mtl file, but my textures dont not show up?
- Check if your .obj and .mtl file have the exact same name
- I have both an .obj file and .mtl file, but my model doesnt show up
- This has to do with the .mtl file, obj's come with different export settings for the mtl file, sometimes the mtl file in itself refers to external files, such as
modelname-Alpha.pngormodelname-RGBA.png, if you have these files move them to the same folder as the mtl file. Otherwise, attempt to re export your obj with different mtl settings. And lastly if you dont really care about the textures, remove the mtl file, and your model will load without textures.
- This has to do with the .mtl file, obj's come with different export settings for the mtl file, sometimes the mtl file in itself refers to external files, such as
- Where can I request new features?
- Where can I report bugs?
- I want to export my note as a pdf, but the 3D scenes arent there.
- If you use the
better Export pdfcommunity plugin you can export your markdown notes with a nice snapshot of your 3D scenes!
- If you use the











