4
0
mirror of https://github.com/nerfstudio-project/nerfstudio.git synced 2026-11-11 18:44:21 +08:00
nerfstudio/extensions/blender_addon.html
2025-07-29 02:30:47 +00:00

775 lines
55 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!doctype html>
<html class="no-js" lang="en" >
<head><meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="color-scheme" content="light dark"><meta name="generator" content="Docutils 0.19: https://docutils.sourceforge.io/" />
<meta property="og:title" content="Blender VFX add-on" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://docs.nerf.studio/extensions/blender_addon.html" />
<meta property="og:description" content="Overview: This Blender add-on allows for compositing with a Nerfstudio render as a background layer by generating a camera path JSON file from the Blender camera path, as well as a way to import Ne..." />
<meta property="og:image" content="https://assets.nerf.studio/opg.png" />
<meta property="og:image:alt" content="Blender VFX add-on" />
<link rel="index" title="Index" href="../genindex.html" /><link rel="search" title="Search" href="../search.html" /><link rel="next" title="Autodesk Maya Plug-in" href="maya_plugin.html" /><link rel="prev" title="Contributing" href="../reference/contributing.html" />
<meta name="generator" content="sphinx-5.2.1, furo 2022.09.29" />
<title>Blender VFX add-on - nerfstudio</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?digest=d81277517bee4d6b0349d71bb2661d4890b5617c" />
<link rel="stylesheet" type="text/css" href="../_static/mystnb.css" />
<link rel="stylesheet" type="text/css" href="../_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="../_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="../_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo-extensions.css?digest=30d1aed668e5c3a91c3e3bf6a60b675221979f0e" />
<style>
body {
--color-code-background: #f8f9fb;
--color-code-foreground: black;
--color-brand-primary: #d34600;
--color-brand-content: #ff6f00;
}
@media not print {
body[data-theme="dark"] {
--color-code-background: #282C34;
--color-code-foreground: #ABB2BF;
--color-brand-primary: #fdd06c;
--color-brand-content: ##fea96a;
}
@media (prefers-color-scheme: dark) {
body:not([data-theme="light"]) {
--color-code-background: #282C34;
--color-code-foreground: #ABB2BF;
--color-brand-primary: #fdd06c;
--color-brand-content: ##fea96a;
}
}
}
</style><script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script>
<script src="../_static/jquery.js"></script>
<script src="../_static/underscore.js"></script>
<script src="../_static/_sphinx_javascript_frameworks_compat.js"></script>
<script src="../_static/doctools.js"></script>
<script src="../_static/sphinx_highlight.js"></script>
<script src="../_static/scripts/furo.js"></script>
<script src="../_static/clipboard.min.js"></script>
<script src="../_static/copybutton.js"></script>
<script>let toggleHintShow = 'Click to show';</script>
<script>let toggleHintHide = 'Click to hide';</script>
<script>let toggleOpenOnPrint = 'true';</script>
<script src="../_static/togglebutton.js"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown, .tag_hide_input div.cell_input, .tag_hide-input div.cell_input, .tag_hide_output div.cell_output, .tag_hide-output div.cell_output, .tag_hide_cell.cell, .tag_hide-cell.cell';</script>
<script src="../_static/design-tabs.js"></script>
<script src="../_static/require.min.js"></script>
<script src="../_static/custom.js"></script>
</head>
<body>
<script>
document.body.dataset.theme = localStorage.getItem("theme") || "auto";
</script>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="svg-toc" viewBox="0 0 24 24">
<title>Contents</title>
<svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 1024 1024">
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM115.4 518.9L271.7 642c5.8 4.6 14.4.5 14.4-6.9V388.9c0-7.4-8.5-11.5-14.4-6.9L115.4 505.1a8.74 8.74 0 0 0 0 13.8z"/>
</svg>
</symbol>
<symbol id="svg-menu" viewBox="0 0 24 24">
<title>Menu</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-menu">
<line x1="3" y1="12" x2="21" y2="12"></line>
<line x1="3" y1="6" x2="21" y2="6"></line>
<line x1="3" y1="18" x2="21" y2="18"></line>
</svg>
</symbol>
<symbol id="svg-arrow-right" viewBox="0 0 24 24">
<title>Expand</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather-chevron-right">
<polyline points="9 18 15 12 9 6"></polyline>
</svg>
</symbol>
<symbol id="svg-sun" viewBox="0 0 24 24">
<title>Light mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="feather-sun">
<circle cx="12" cy="12" r="5"></circle>
<line x1="12" y1="1" x2="12" y2="3"></line>
<line x1="12" y1="21" x2="12" y2="23"></line>
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
<line x1="1" y1="12" x2="3" y2="12"></line>
<line x1="21" y1="12" x2="23" y2="12"></line>
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
</svg>
</symbol>
<symbol id="svg-moon" viewBox="0 0 24 24">
<title>Dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-moon">
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
</svg>
</symbol>
<symbol id="svg-sun-half" viewBox="0 0 24 24">
<title>Auto light/dark mode</title>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="icon-tabler-shadow">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<circle cx="12" cy="12" r="9" />
<path d="M13 12h5" />
<path d="M13 15h4" />
<path d="M13 18h1" />
<path d="M13 9h4" />
<path d="M13 6h1" />
</svg>
</symbol>
</svg>
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation">
<input type="checkbox" class="sidebar-toggle" name="__toc" id="__toc">
<label class="overlay sidebar-overlay" for="__navigation">
<div class="visually-hidden">Hide navigation sidebar</div>
</label>
<label class="overlay toc-overlay" for="__toc">
<div class="visually-hidden">Hide table of contents sidebar</div>
</label>
<div class="page">
<header class="mobile-header">
<div class="header-left">
<label class="nav-overlay-icon" for="__navigation">
<div class="visually-hidden">Toggle site navigation sidebar</div>
<i class="icon"><svg><use href="#svg-menu"></use></svg></i>
</label>
</div>
<div class="header-center">
<a href="../index.html"><div class="brand">nerfstudio</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-header-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
</header>
<aside class="sidebar-drawer">
<div class="sidebar-container">
<div class="sidebar-sticky"><a
class="sidebar-brand"
href="../index.html"
>
<div class="sidebar-logo-container">
<img
class="sidebar-logo only-light"
src="../_static/imgs/logo.png"
alt="Light Logo"
/>
<img
class="sidebar-logo only-dark"
src="../_static/imgs/logo-dark.png"
alt="Dark Logo"
/>
</div>
</a>
<div style="text-align: center">
<script async defer src="https://buttons.github.io/buttons.js"></script>
<!-- Place this tag where you want the button to render. -->
<a
class="github-button"
href="https://github.com/nerfstudio-project/nerfstudio/"
data-color-scheme="no-preference: light; light: light; dark: light;"
data-size="large"
data-show-count="true"
aria-label="Download buttons/github-buttons on GitHub"
>
Github
</a>
<br />
<a
href="https://colab.research.google.com/github/nerfstudio-project/nerfstudio/blob/main/colab/demo.ipynb"
style="
background-color: #ebf0f4;
background-image: linear-gradient(180deg, #f6f8fa, #ebf0f4 90%);
border-radius: 3px;
border: 1px solid #1b1f2426;
display: inline-flex;
cursor: pointer;
color: #0d0d0d;
font-family: Arial;
font-size: 12px;
font-weight: bold;
padding: 5px 41px;
line-height: 16px;
text-decoration: none;
"
>
<svg
viewBox="0 0 24 24"
width="16"
height="16"
class="octicon octicon-mark-github"
>
<g>
<path
d="M4.54,9.46,2.19,7.1a6.93,6.93,0,0,0,0,9.79l2.36-2.36A3.59,3.59,0,0,1,4.54,9.46Z"
style=""
fill="#E8710A"
></path>
<path
d="M2.19,7.1,4.54,9.46a3.59,3.59,0,0,1,5.08,0l1.71-2.93h0l-.1-.08h0A6.93,6.93,0,0,0,2.19,7.1Z"
style=""
fill="#F9AB00"
></path>
<path
d="M11.34,17.46h0L9.62,14.54a3.59,3.59,0,0,1-5.08,0L2.19,16.9a6.93,6.93,0,0,0,9,.65l.11-.09"
style=""
fill="#F9AB00"
></path>
<path
d="M12,7.1a6.93,6.93,0,0,0,0,9.79l2.36-2.36a3.59,3.59,0,1,1,5.08-5.08L21.81,7.1A6.93,6.93,0,0,0,12,7.1Z"
style=""
fill="#F9AB00"
></path>
<path
d="M21.81,7.1,19.46,9.46a3.59,3.59,0,0,1-5.08,5.08L12,16.9A6.93,6.93,0,0,0,21.81,7.1Z"
style=""
fill="#E8710A"
></path>
</g>
</svg>
<span>&nbspcolab</span></a
>
</div><form class="sidebar-search-container" method="get" action="../search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
<input type="hidden" name="check_keywords" value="yes">
<input type="hidden" name="area" value="default">
</form>
<div id="searchbox"></div><div class="sidebar-scroll"><div class="sidebar-tree">
<p class="caption" role="heading"><span class="caption-text">Getting Started</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/first_nerf.html">Training your first model</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/existing_dataset.html">Using existing data</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/custom_dataset.html">Using custom data</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/viewer_quickstart.html">Using the viewer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/export_geometry.html">Export geometry</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quickstart/data_conventions.html">Data conventions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../reference/contributing.html">Contributing</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Extensions</span></p>
<ul class="current">
<li class="toctree-l1 current current-page"><a class="current reference internal" href="#">Blender VFX add-on</a></li>
<li class="toctree-l1"><a class="reference internal" href="maya_plugin.html">Autodesk Maya Plug-in</a></li>
<li class="toctree-l1"><a class="reference internal" href="unreal_engine.html">Exporting to Unreal Engine</a></li>
<li class="toctree-l1"><a class="reference internal" href="sdfstudio.html">SDFStudio</a></li>
</ul>
<p class="caption" role="heading"><span class="caption-text">NeRFology</span></p>
<ul>
<li class="toctree-l1 has-children"><a class="reference internal" href="../nerfology/methods/index.html">Methods</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" role="switch" type="checkbox"/><label for="toctree-checkbox-1"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/instant_ngp.html"> Instant-NGP</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/splat.html"> Splatfacto</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/splatw.html"> Splatfacto-W</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/in2n.html"> Instruct-NeRF2NeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/igs2gs.html"> Instruct-GS2GS</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/signerf.html"> SIGNeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/kplanes.html"> K-Planes</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/lerf.html"> LERF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/livescene.html"> LiveScene</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/feature_splatting.html"> Feature-Splatting</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/mipnerf.html"> Mip-NeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/nerf.html"> NeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/nerfacto.html"> Nerfacto</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/nerfbusters.html"> Nerfbusters</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/nerfplayer.html"> NeRFPlayer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/tetranerf.html"> Tetra-NeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/tensorf.html"> TensoRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/generfacto.html"> Generfacto</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/pynerf.html"> PyNeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/seathru_nerf.html"> SeaThru-NeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/zipnerf.html"> Zip-NeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/bionerf.html"> BioNeRF</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/nerf2gs2nerf.html"> NeRFtoGSandBack</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/methods/opennerf.html"> OpenNeRF</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../nerfology/model_components/index.html">Model components</a><input class="toctree-checkbox" id="toctree-checkbox-2" name="toctree-checkbox-2" role="switch" type="checkbox"/><label for="toctree-checkbox-2"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/model_components/visualize_cameras.html"> Cameras models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/model_components/visualize_samples.html"> Sample representation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/model_components/visualize_samplers.html"> Ray samplers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/model_components/visualize_spatial_distortions.html"> Spatial distortions</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nerfology/model_components/visualize_encoders.html"> Encoders</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Developer Guides</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../developer_guides/new_methods.html">Adding a New Method</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../developer_guides/pipelines/index.html">Pipelines overview</a><input class="toctree-checkbox" id="toctree-checkbox-3" name="toctree-checkbox-3" role="switch" type="checkbox"/><label for="toctree-checkbox-3"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2 has-children"><a class="reference internal" href="../developer_guides/pipelines/dataparsers.html">DataParsers</a><input class="toctree-checkbox" id="toctree-checkbox-4" name="toctree-checkbox-4" role="switch" type="checkbox"/><label for="toctree-checkbox-4"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/data/dataparsers.html">Data Parsers</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/pipelines/datamanagers.html">DataManagers</a></li>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/pipelines/models.html">Models</a></li>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/pipelines/fields.html">Fields</a></li>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/pipelines/pipelines.html">Pipelines</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../developer_guides/viewer/index.html">Viewer</a><input class="toctree-checkbox" id="toctree-checkbox-5" name="toctree-checkbox-5" role="switch" type="checkbox"/><label for="toctree-checkbox-5"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/viewer/custom_gui.html">Custom GUI</a></li>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/viewer/viewer_control.html">Python Viewer Control</a></li>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/viewer/local_viewer.html">(Legacy Viewer) Local Server</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../developer_guides/config.html">Customizable configs</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../developer_guides/debugging_tools/index.html">Debugging tools</a><input class="toctree-checkbox" id="toctree-checkbox-6" name="toctree-checkbox-6" role="switch" type="checkbox"/><label for="toctree-checkbox-6"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/debugging_tools/local_logger.html">Local writer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/debugging_tools/profiling.html">Code profiling support</a></li>
<li class="toctree-l2"><a class="reference internal" href="../developer_guides/debugging_tools/benchmarking.html">Benchmarking workflow</a></li>
</ul>
</li>
</ul>
<p class="caption" role="heading"><span class="caption-text">Reference</span></p>
<ul>
<li class="toctree-l1 has-children"><a class="reference internal" href="../reference/cli/index.html">CLI</a><input class="toctree-checkbox" id="toctree-checkbox-7" name="toctree-checkbox-7" role="switch" type="checkbox"/><label for="toctree-checkbox-7"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../reference/cli/ns_install_cli.html">ns-install-cli</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/cli/ns_process_data.html">ns-process-data</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/cli/ns_download_data.html">ns-download-data</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/cli/ns_train.html">ns-train</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/cli/ns_render.html">ns-render</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/cli/ns_viewer.html">ns-viewer</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/cli/ns_export.html">ns-export</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/cli/ns_eval.html">ns-eval</a></li>
</ul>
</li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../reference/api/index.html">API</a><input class="toctree-checkbox" id="toctree-checkbox-8" name="toctree-checkbox-8" role="switch" type="checkbox"/><label for="toctree-checkbox-8"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l2"><a class="reference internal" href="../reference/api/cameras.html">Cameras</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/api/config.html">Configs</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../reference/api/data/index.html">Data</a><input class="toctree-checkbox" id="toctree-checkbox-9" name="toctree-checkbox-9" role="switch" type="checkbox"/><label for="toctree-checkbox-9"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/data/dataparsers.html">Data Parsers</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/data/datamanagers.html">Datamanagers</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/data/datasets.html">Datasets</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/data/utils.html">Utils</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/api/fields.html">Fields</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../reference/api/field_components/index.html">Field Modules</a><input class="toctree-checkbox" id="toctree-checkbox-10" name="toctree-checkbox-10" role="switch" type="checkbox"/><label for="toctree-checkbox-10"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/field_components/encodings.html">Encodings</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/field_components/embeddings.html">Embeddings</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/field_components/field_heads.html">Field Heads</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/field_components/mlp.html">MLP</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/field_components/spatial_distortions.html">Spatial Distortions</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/api/models.html">Models</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../reference/api/model_components/index.html">Model components</a><input class="toctree-checkbox" id="toctree-checkbox-11" name="toctree-checkbox-11" role="switch" type="checkbox"/><label for="toctree-checkbox-11"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/model_components/ray_sampler.html">Ray Sampler</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/model_components/losses.html">Losses</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/model_components/renderers.html">Renderers</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/api/optimizers.html">Engine</a></li>
<li class="toctree-l2"><a class="reference internal" href="../reference/api/plugins.html">Plugins</a></li>
<li class="toctree-l2 has-children"><a class="reference internal" href="../reference/api/utils/index.html">Utils</a><input class="toctree-checkbox" id="toctree-checkbox-12" name="toctree-checkbox-12" role="switch" type="checkbox"/><label for="toctree-checkbox-12"><div class="visually-hidden">Toggle child pages in navigation</div><i class="icon"><svg><use href="#svg-arrow-right"></use></svg></i></label><ul>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/utils/colors.html">Colors</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/utils/math.html">Math</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/utils/colormaps.html">Colormaps</a></li>
<li class="toctree-l3"><a class="reference internal" href="../reference/api/utils/tensor_dataclass.html">TensorDataclass</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../reference/api/viewer.html">Viewer</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
</aside>
<div class="main">
<div class="content">
<div class="article-container">
<a href="#" class="back-to-top muted-link">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M13 20h-2V8l-5.5 5.5-1.42-1.42L12 4.16l7.92 7.92-1.42 1.42L13 8v12z"></path>
</svg>
<span>Back to top</span>
</a>
<div class="content-icon-container">
<div class="theme-toggle-container theme-toggle-content">
<button class="theme-toggle">
<div class="visually-hidden">Toggle Light / Dark / Auto color theme</div>
<svg class="theme-icon-when-auto"><use href="#svg-sun-half"></use></svg>
<svg class="theme-icon-when-dark"><use href="#svg-moon"></use></svg>
<svg class="theme-icon-when-light"><use href="#svg-sun"></use></svg>
</button>
</div>
<label class="toc-overlay-icon toc-content-icon" for="__toc">
<div class="visually-hidden">Toggle table of contents sidebar</div>
<i class="icon"><svg><use href="#svg-toc"></use></svg></i>
</label>
</div>
<article role="main">
<section class="tex2jax_ignore mathjax_ignore" id="blender-vfx-add-on">
<h1>Blender VFX add-on<a class="headerlink" href="#blender-vfx-add-on" title="Permalink to this heading">#</a></h1>
<p align="center">
<iframe width="728" height="409" src="https://www.youtube.com/embed/vDhj6j7kfWM" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
</p>
<section id="overview">
<h2>Overview<a class="headerlink" href="#overview" title="Permalink to this heading">#</a></h2>
<p>This Blender add-on allows for compositing with a Nerfstudio render as a background layer by generating a camera path JSON file from the Blender camera path, as well as a way to import Nerfstudio JSON files as a Blender camera baked with the Nerfstudio camera path. This add-on also allows compositing multiple NeRF objects into a NeRF scene. This is achieved by importing a mesh or point-cloud representation of the NeRF scene from Nerfstudio into Blender and getting the camera coordinates relative to the transformations of the NeRF representation. Dynamic FOV from the Blender camera is supported and will match the Nerfstudio render. Perspective, equirectangular, VR180, and omnidirectional stereo (VR 360) cameras are supported. This add-on also supports Gaussian Splatting scenes as well, however equirectangular and VR video rendering is not currently supported for splats.</p>
<center>
<img width="800" alt="image" src="https://user-images.githubusercontent.com/9502341/211442247-99d1ebc7-3ef9-46f7-9bcc-0e18553f19b7.PNG">
</center>
</section>
<section id="add-on-setup-instructions">
<h2>Add-on Setup Instructions<a class="headerlink" href="#add-on-setup-instructions" title="Permalink to this heading">#</a></h2>
<ol class="arabic">
<li><p>The add-on requires Blender 3.0 or newer, install Blender <a class="reference external" href="https://www.blender.org/">here</a>.</p></li>
<li><p>Download <a href="https://raw.githubusercontent.com/nerfstudio-project/nerfstudio/main/nerfstudio/scripts/blender/nerfstudio_blender.py" download="nerfstudio_blender.py">Blender Add-on Script</a></p></li>
<li><p>Install and enable the add-on in Blender in <code class="docutils literal notranslate"><span class="pre">Edit</span> <span class="pre">→</span> <span class="pre">Preferences</span> <span class="pre">→</span> <span class="pre">Add-Ons</span></code>. The add-on will be visible in the Render Properties tab on the right panel.</p>
<center>
<img width="500" alt="image" src="https://user-images.githubusercontent.com/9502341/232202430-d4a38ac7-2566-4975-97a4-76220f336511.png">
</center>
</li>
<li><p>The add-on should now be installed in the <code class="docutils literal notranslate"><span class="pre">Render</span> <span class="pre">Properties</span></code> panel</p>
<center>
<img width="300" alt="image" src="https://user-images.githubusercontent.com/9502341/232202091-c13c66c4-f119-4f15-aa3e-3bf736371821.png">
</center>
</li>
</ol>
</section>
<section id="scene-setup">
<h2>Scene Setup<a class="headerlink" href="#scene-setup" title="Permalink to this heading">#</a></h2>
<ol class="arabic simple">
<li><p>Export the mesh or point cloud representation of the NeRF from Nerfstudio, which will be used as reference for the actual NeRF in the Blender scene. Mesh export at a good quality is preferred, however, if the export is not clear or the NeRF is large, a detailed point cloud export will also work. Keep the <code class="docutils literal notranslate"><span class="pre">save_world_frame</span></code> flag as False or in the viewer, de-select the “Save in world frame” checkbox to keep the correct coordinate system for the add-on.</p></li>
<li><p>Import the mesh or point cloud representation of the NeRF into the scene. You may need to crop the mesh further. Since it is used as a reference and won’t be visible in the final render, only the parts that the blender animation will interact with may be necessary to import.</p></li>
<li><p>Select the NeRF mesh or point cloud in the add-on.</p></li>
<li><p>Resize, position, or rotate the NeRF representation to fit your scene.</p></li>
</ol>
</section>
<section id="generate-nerfstudio-json-camera-path-from-blender-camera">
<h2>Generate Nerfstudio JSON Camera Path from Blender Camera<a class="headerlink" href="#generate-nerfstudio-json-camera-path-from-blender-camera" title="Permalink to this heading">#</a></h2>
<ol class="arabic">
<li><p>There are a few ways to hide the reference mesh for the Blender render</p>
<ul class="simple">
<li><p>In object properties, select “Shadow Catcher”. This makes the representation invisible in the render, but all shadows cast on it will render. You may have to switch to the cycles renderer to see the shadow catcher option.</p></li>
</ul>
<center>
<img width="300" alt="image" src="https://user-images.githubusercontent.com/9502341/211244787-859ca9b5-6ba2-4056-aaf2-c89fc6370c2a.png">
</center>
<ul class="simple">
<li><p>Note: This may not give ideal results if the mesh is not very clear or occludes other objects in the scene. If this is the case, you can hide the mesh from the render instead by clicking the camera button in the Outliner next to its name.</p></li>
</ul>
<center>
<img width="300" alt="image" src="https://user-images.githubusercontent.com/9502341/211244858-54091d36-086d-4211-a7d9-75dcfdcb1436.png">
</center>
</li>
<li><p>Verify that the animation plays and the NeRF representation does not occlude the camera.</p></li>
<li><p>Go to the Nerfstudio Add-on in Render Properties and expand the “Nerfstudio Path Generator” tab in the panel. Use the object selector to select the NeRF representation. Then, select the file path for the output JSON camera path file.</p></li>
<li><p>Click “Generate JSON file”. The output JSON file is named <code class="docutils literal notranslate"><span class="pre">camera_path_blender.json</span></code>.</p></li>
</ol>
<center>
<img width="800" alt="image" src="https://user-images.githubusercontent.com/9502341/211442361-999fe040-a1ed-43f0-b079-0c659d70862f.png">
</center>
<ol class="arabic simple" start="5">
<li><p>Render the NeRF with the generated camera path using Nerfstudio in the command prompt or terminal.</p></li>
<li><p>Before rendering the Blender animation, go to the Render Properties and in the Film settings select “Transparent” so that the render will be rendered with a clear background to allow it to be composited over the NeRF render.</p></li>
</ol>
<center>
<img width="200" alt="image" src="https://user-images.githubusercontent.com/9502341/211244801-c555c3b5-ab3f-4d84-9f64-68559b03ff37.png">
</center>
<ol class="arabic simple" start="7">
<li><p>Now the scene can be rendered and composited over the camera aligned Nerfstudio render.</p></li>
</ol>
<center>
<img width="800" alt="image" src="https://user-images.githubusercontent.com/9502341/211245025-2ef5adbe-9306-4eab-b761-c78e3ec187bd.png">
</center>
<section id="examples">
<h3>Examples<a class="headerlink" href="#examples" title="Permalink to this heading">#</a></h3>
<p align="center">
<img width="300" alt="image" src="https://user-images.githubusercontent.com/9502341/212463397-ba34d60f-a744-47a1-95ce-da6945a7fc00.gif">
<img width="300" alt="image" src="https://user-images.githubusercontent.com/9502341/212461881-e2096710-4732-4f20-9ba7-1aeb0d0d653b.gif">
</p>
</section>
<section id="additional-details">
<h3>Additional details<a class="headerlink" href="#additional-details" title="Permalink to this heading">#</a></h3>
<ul>
<li><p>You can also apply an environment texture to the Blender scene by using Nerfstudio to render an equirectangular image (360 image) of the NeRF from a place in the scene.</p></li>
<li><p>The settings for the Blender equirectangular camera are: “Panoramic” camera type and panorama type of “Equirectangular”.</p>
<center>
<img width="200" alt="image" src="https://user-images.githubusercontent.com/9502341/211245895-76dfb65d-ed81-4c36-984a-4c683fc0e1b4.png">
</center>
</li>
<li><p>The generated JSON camera path follows the user specified frame start, end, and step fields in the Output Properties in Blender. The JSON file specifies the user specified x and y render resolutions at the given % in the Output Properties.</p></li>
<li><p>The add-on computes the camera coordinates based on the active camera in the scene.</p></li>
<li><p>FOV animated changes of the camera will be matched with the NeRF render.</p></li>
<li><p>Perspective, equirectangular, VR180, and omnidirectional stereo cameras are supported and can be configured within Blender.</p></li>
<li><p>The generated JSON file can be imported into Nerfstudio. Each keyframe of the camera transform in the frame sequence in Blender will be a keyframe in Nerfstudio. The exported JSON camera path is baked, where each frame in the sequence is a keyframe. This is to ensure that frame interpolation across Nerfstudio and Blender do not differ.</p>
<center>
<img width="800" alt="image" src="https://user-images.githubusercontent.com/9502341/211245108-587a97f7-d48d-4515-b09a-5644fd966298.png">
</center>
</li>
<li><p>It is recommended to run the camera path in the Nerfstudio web interface with the NeRF to ensure that the NeRF is visible throughout the camera path.</p></li>
<li><p>The fps and keyframe timestamps are based on the “Frame Rate” setting in the Output Properties in Blender.</p></li>
<li><p>The NeRF representation can also be transformed (position, rotation, and scale) as well as animated.</p></li>
<li><p>The pivot point of the NeRF representation should not be changed</p></li>
<li><p>It is recommended to export a high fidelity mesh as the NeRF representation from Nerfstudio. However if that is not possible or the scene is too large, a point cloud representation also works.</p></li>
<li><p>For compositing, it is recommended to convert the video render into image frames to ensure the Blender and NeRF renders are in sync.</p></li>
<li><p>Currently, dynamic camera focus is not supported.</p></li>
<li><p>Compositing with Blender Objects and VR180 or ODS Renders</p>
<ul>
<li><p>Configure the Blender camera to be panoramic equirectangular and enable stereoscopy in the Output Properties. For the VR180 Blender camera, set the panoramic longitude min and max to -90 and 90.</p></li>
<li><p>Under the Stereoscopy panel the Blender camera settings, change the mode to “Parallel”, set the Interocular Distance to 0.064 m, and checkmark “Spherical Stereo”.</p>
<center>
<img width="300" alt="image" src="https://github-production-user-asset-6210df.s3.amazonaws.com/9502341/253217833-fd607601-2b81-48ab-ac5d-e55514a588da.png">
</center>
</li>
</ul>
</li>
<li><p>Fisheye and orthographic cameras are not supported.</p></li>
<li><p>Renders with Gaussian Splats are supported, but the point cloud or mesh representation would need to be generated from training a NeRF on the same dataset.</p></li>
<li><p>A walkthrough of this section is included in the tutorial video.</p></li>
</ul>
</section>
</section>
<section id="create-blender-camera-from-nerfstudio-json-camera-path">
<h2>Create Blender Camera from Nerfstudio JSON Camera Path<a class="headerlink" href="#create-blender-camera-from-nerfstudio-json-camera-path" title="Permalink to this heading">#</a></h2>
<p align="center">
<img width="800" alt="image" src="https://user-images.githubusercontent.com/9502341/211246016-88bc6031-01d4-418f-8230-fb8c29212200.png">
</p>
<ol class="arabic simple">
<li><p>Expand the “Nerfstudio Camera Generator” tab in the panel. After inputting the NeRF representation, select the JSON Nerfstudio file and click “Create Camera from JSON”</p></li>
<li><p>A new camera named “NerfstudioCamera” should appear in the viewport with the camera path and FOV of the input file. This camera’s type will match the Nerfstudio input file, except fisheye cameras.</p></li>
</ol>
<section id="id1">
<h3>Additional details<a class="headerlink" href="#id1" title="Permalink to this heading">#</a></h3>
<ul class="simple">
<li><p>Since only the camera path, camera type, and FOV are applied on the created Blender camera, the timing and duration of the animation may need to be adjusted.</p></li>
<li><p>Fisheye cameras imported from Nerfstudio are not supported and will default to perspective cameras.</p></li>
<li><p>Animated NeRF representations will not be reflected in the imported camera path animation.</p></li>
<li><p>The newly created camera is not active by default, so you may need to right click and select “Set Active Camera”.</p></li>
<li><p>The newly created Blender camera animation is baked, where each frame in the sequence is a keyframe. This is to ensure that frame interpolation across Nerfstudio and Blender do not differ.</p></li>
<li><p>The resolution settings from the input JSON file do not affect the Blender render settings</p></li>
<li><p>Scale of the camera is not keyframed from the Nerfstudio camera path.</p></li>
<li><p>This newly created camera has a sensor fit of “Vertical”</p></li>
</ul>
</section>
</section>
<section id="compositing-nerf-objects-in-nerf-environments">
<h2>Compositing NeRF Objects in NeRF Environments<a class="headerlink" href="#compositing-nerf-objects-in-nerf-environments" title="Permalink to this heading">#</a></h2>
<p>You can composite NeRF objects into a scene with a NeRF background by rendering the cropped NeRF object along with an accumulation render as an alpha mask and compositing that over the background NeRF render.</p>
<p align="center">
<img width="450" alt="image" src="https://user-images.githubusercontent.com/9502341/232261745-80e36ae1-8527-4256-bbd0-83461e6f4324.jpg">
</p>
<ol class="arabic">
<li><p>Import the background NeRF scene as a point cloud (or mesh, but point cloud is preferred for large scenes).</p></li>
<li><p>Export a cropped NeRF mesh of the NeRF object(s)</p>
<ul class="simple">
<li><p>Open the NeRF object from the Nerfstudio viewer and select “Crop Viewport” and accordingly adjust the Scale and Center values of the bounding box to crop the NeRF scene to around the bounds of the object of interest.</p></li>
</ul>
<center>
<img width="300" alt="image" src="https://user-images.githubusercontent.com/9502341/232264554-26357747-6f09-4084-9710-dabf60c61909.jpg">
</center>
<ul class="simple">
<li><p>Copy over the scale and center values into the Export panel and export the NeRF object as a mesh (point cloud will also work but shadows can be rendered if the object is a mesh)</p></li>
<li><p>Keep note of the scale and center values for the crop. This can be done by creating a new JSON camera path in the editor which will add a crop section towards the end of the file.</p></li>
</ul>
<center>
<img width="200" alt="image" src="https://user-images.githubusercontent.com/9502341/232264430-0b991e20-838f-4e06-9834-7d1d8c1d0042.png">
</center>
</li>
<li><p>Import the NeRF object representation. Rescale and position the scene and NeRF object and background environment. You can also animate either of them.</p></li>
<li><p>(Optional) To add shadows of the NeRF object(s)</p>
<ul class="simple">
<li><p>Add a plane representing the ground of the environment. In object properties, select “Shadow Catcher” under Visibility. You may have to switch to the cycles renderer to see the shadow catcher option.</p></li>
<li><p>In the object properties of the NeRF object, go to the Ray Visibility section and deselect the “Camera” option. This will hide the mesh in the Blender render, but keep its shadow.</p></li>
</ul>
<center>
<img width="200" alt="image" src="https://user-images.githubusercontent.com/9502341/232265212-ca077af8-fb3a-491f-8d60-304cb9fae57e.png">
</center>
<ul class="simple">
<li><p>Render the Blender animation with only the shadow of the object on the shadow catcher visible. Render with a transparent background by selecting “Transparent” under the Film Settings in the Render Properties.</p></li>
</ul>
</li>
<li><p>Go to the Nerfstudio Add-on in Render Properties and expand the “Nerfstudio Path Generator” tab in the panel. Use the object selector to select the NeRF environment representation. Then, select the file path for the output JSON camera path file. Click “Generate JSON file”. The output JSON file is named <code class="docutils literal notranslate"><span class="pre">camera_path_blender.json</span></code>. It is recommended to rename this JSON file to keep track of the multiple camera paths that will be used to construct the full render.</p></li>
<li><p>Generate a Nerfstudio camera path now for the NeRF object. Select the object selector to select the NeRF object. Before generating the new JSON file, you may need to rename the previously generated camera path for the environment or move it to a different directory otherwise the new JSON file will overwrite it. Click “Generate JSON file”. The new output JSON file is named <code class="docutils literal notranslate"><span class="pre">camera_path_blender.json</span></code>. You will need to repeat this process for each NeRF object you want to composite in your scene.</p></li>
<li><p>Render the NeRF of the background environment using the generated camera path for the environment using the Nerfstudio in the command line or terminal.</p></li>
<li><p>Render the NeRF object</p>
<ul class="simple">
<li><p>Open the recently generated blender Nerfstudio JSON camera path and add the crop parameters to the camera path. This section will be placed towards the end of the Blender Nerfstudio camera path after the <code class="docutils literal notranslate"><span class="pre">is_cycle</span></code> field. This can be done by copying over the crop section from the JSON camera path with the scene crop which was exported earlier. Alternatively, you can enter the crop values manually in this format.</p></li>
</ul>
<center>
<img width="200" alt="image" src="https://user-images.githubusercontent.com/9502341/232264689-d2e7747c-ce53-425b-810b-1b2954eceb62.png">
</center>
<ul class="simple">
<li><p>Render the NeRF object using Nerfstudio and the edited camera path in the command line or terminal. This will be the RGB render.</p></li>
<li><p>Next, render the accumulation render as an alpha mask of the NeRF object by adding the command line argument <code class="docutils literal notranslate"><span class="pre">--rendered-output-names</span> <span class="pre">accumulation</span></code> to the render command.</p></li>
</ul>
<center>
<img width="450" alt="image" src="https://user-images.githubusercontent.com/9502341/232264813-195c970f-b194-4761-843b-983123f128f7.jpg">
</center>
</li>
<li><p>Convert each of the Nerfstudio render videos into an image sequence of frames as PNG or JPG files. This will ensure that the frames will be aligned when compositing. You can convert the video mp4 to an image sequence by creating a Blender Video Editing file and rendering the mp4 as JPGs or PNGs.</p></li>
<li><p>Composite the NeRF renders in a video editing software such as Adobe Premiere Pro.</p>
<ul class="simple">
<li><p>Place the render of the Nerfstudio background environment at the lowest layer, then place the shadow render of the NeRF object if created.</p></li>
<li><p>Place the RGB NeRF render of the NeRF object over the environment (and shadow if present) layers and then place the accumulation NeRF object render over the RGB NeRF object render.</p></li>
<li><p>Apply a filter to use the accumulation render as an alpha mask. In Premiere Pro, apply the effect “Track Matte Key” to the RGB render and select the “Matte” as the video track of the accumulation render and under “Composite Using” select “Matte Luma”.</p></li>
</ul>
</li>
</ol>
<section id="id2">
<h3>Additional Details<a class="headerlink" href="#id2" title="Permalink to this heading">#</a></h3>
<ul class="simple">
<li><p>The RGB and accumulation renders will need to be rendered for each NeRF cropped object in the scene, but not for the NeRF environment if it is not cropped.</p></li>
<li><p>If you will composite a shadow layer, the quality of the exported mesh of the NeRF object should have enough fidelity to cast a shadow, but the texture doesn’t need to be clear.</p></li>
<li><p>If motion tracking or compositing over real camera footage, you can add planes or cubes to represent walls or doorways as shadow catcher or holdout objects. This will composite the shadow layer over the NeRF environment and help create alpha masks.</p></li>
<li><p>The pivot point of the NeRF representations should not be changed.</p></li>
<li><p>A walkthrough of this section is included in the tutorial video.</p></li>
</ul>
</section>
<section id="id3">
<h3>Examples<a class="headerlink" href="#id3" title="Permalink to this heading">#</a></h3>
<p align="center">
<img width="300" alt="image" src="https://user-images.githubusercontent.com/9502341/232274012-27fb912c-3d3e-47b2-bb6b-68abf8f0692a.gif">
<img width="225" alt="image" src="https://user-images.githubusercontent.com/9502341/232274049-d03e9768-8905-4668-b41b-d8ad4f122829.gif">
</p>
</section>
</section>
<section id="implementation-details">
<h2>Implementation Details<a class="headerlink" href="#implementation-details" title="Permalink to this heading">#</a></h2>
<p>For generating the JSON camera path, we iterate over the scene frame sequence (from the start to the end with step intervals) and get the camera 4x4 world matrix at each frame. The world transformation matrix gives the position, rotation, and scale of the camera. We then obtain the world matrix of the NeRF representation at each frame and transform the camera coordinates with this to get the final camera world matrix. This allows us to re-position, rotate, and scale the NeRF representation in Blender and generate the right camera path to render the NeRF accordingly in Nerfstudio. Additionally, we calculate the FOV of the camera at each frame based on the sensor fit (horizontal or vertical), angle of view, and aspect ratio.
Next, we construct the list of keyframes which is very similar to the world matrices of the transformed camera matrix.
Camera properties in the JSON file are based on user specified fields such as resolution (user specified in Output Properties in Blender), camera type (Perspective or Equirectangular). In the JSON file, <code class="docutils literal notranslate"><span class="pre">aspect</span></code> is specified as 1.0, <code class="docutils literal notranslate"><span class="pre">smoothness_value</span></code> is set to 0, and <code class="docutils literal notranslate"><span class="pre">is_cycle</span></code> is set to false. The Nerfstudio render is the fps specified in Blender where the duration is the total number of frames divided by the fps.
Finally, we construct the full JSON object and write it to the file path specified by the user.</p>
<p>For generating the camera from the JSON file, we create a new Blender camera based on the input file and iterate through the <code class="docutils literal notranslate"><span class="pre">camera_path</span></code> field in the JSON to get the world matrix of the object from the <code class="docutils literal notranslate"><span class="pre">matrix_to_world</span></code> and similarly get the FOV from the <code class="docutils literal notranslate"><span class="pre">fov</span></code> fields. At each iteration, we set the camera to these parameters and insert a keyframe based on the position, rotation, and scale of the camera as well as the focal length of the camera based on the vertical FOV input.</p>
</section>
</section>
</article>
</div>
<footer>
<div class="related-pages">
<a class="next-page" href="maya_plugin.html">
<div class="page-info">
<div class="context">
<span>Next</span>
</div>
<div class="title">Autodesk Maya Plug-in</div>
</div>
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
</a>
<a class="prev-page" href="../reference/contributing.html">
<svg class="furo-related-icon"><use href="#svg-arrow-right"></use></svg>
<div class="page-info">
<div class="context">
<span>Previous</span>
</div>
<div class="title">Contributing</div>
</div>
</a>
</div>
<div class="bottom-of-page">
<div class="left-details">
<div class="copyright">
Copyright &#169; 2022, nerfstudio Team
</div>
Made with <a href="https://www.sphinx-doc.org/">Sphinx</a> and <a class="muted-link" href="https://pradyunsg.me">@pradyunsg</a>'s
<a href="https://github.com/pradyunsg/furo">Furo</a>
</div>
<div class="right-details">
<div class="icons">
</div>
</div>
</div>
</footer>
</div>
<aside class="toc-drawer">
<div class="toc-sticky toc-scroll">
<div class="toc-title-container">
<span class="toc-title">
On this page
</span>
</div>
<div class="toc-tree-container">
<div class="toc-tree">
<ul>
<li><a class="reference internal" href="#">Blender VFX add-on</a><ul>
<li><a class="reference internal" href="#overview">Overview</a></li>
<li><a class="reference internal" href="#add-on-setup-instructions">Add-on Setup Instructions</a></li>
<li><a class="reference internal" href="#scene-setup">Scene Setup</a></li>
<li><a class="reference internal" href="#generate-nerfstudio-json-camera-path-from-blender-camera">Generate Nerfstudio JSON Camera Path from Blender Camera</a><ul>
<li><a class="reference internal" href="#examples">Examples</a></li>
<li><a class="reference internal" href="#additional-details">Additional details</a></li>
</ul>
</li>
<li><a class="reference internal" href="#create-blender-camera-from-nerfstudio-json-camera-path">Create Blender Camera from Nerfstudio JSON Camera Path</a><ul>
<li><a class="reference internal" href="#id1">Additional details</a></li>
</ul>
</li>
<li><a class="reference internal" href="#compositing-nerf-objects-in-nerf-environments">Compositing NeRF Objects in NeRF Environments</a><ul>
<li><a class="reference internal" href="#id2">Additional Details</a></li>
<li><a class="reference internal" href="#id3">Examples</a></li>
</ul>
</li>
<li><a class="reference internal" href="#implementation-details">Implementation Details</a></li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</aside>
</div>
</div></body>
</html>