GithubHelp home page GithubHelp logo

idlabmedia / blender-lightfield-addon Goto Github PK

View Code? Open in Web Editor NEW
33.0 2.0 4.0 9.39 MB

Blender addon to configure and render light fields

License: MIT License

Python 100.00%
blender blender-addon addon lightfield lightfields camera multi-view

blender-lightfield-addon's Introduction

Blender Addon for Light Field Rendering

This addon allows to quickly create several multi-camera setups in Blender. It automatically renders and saves the generated images (and depth information). The addon currently supports 4 basic multi-camera setup types, which can be combined to create large image datasets:

  • Plane: all cameras are positioned on a rectangular grid and rotated to look along the normal of the plane.
  • Cuboid: the Plane setup is copied to the 6 faces of a cuboid.
  • Cylinder: the Plane setup is wrapped around a cylinder.
  • Sphere: each camera is positioned on a sphere and rotated to look along the normal of that sphere at its position. To get mostly evenly spaced cameras, the 3D positions of the vertices of an Icosphere are used.

Requirements

Blender 2.80 or higher.

Installation

First, identify where Blender is installed. If you download Blender straight from the website, chances are that it is sitting in a personal folder, like your downloads folder. If you have Blender installed through some package manager or intaller wizard, it might be installed in system folders:

  • Linux: /usr/share/blender/
  • Windows: C:\Program Files\Blender Foundation\Blender

Option 1: Clone into the Blender addon directory

The easiest way is to clone the repository directly into the Blender addon directory.

cd /path/to/blender/<version>/scripts/addons/
git clone https://github.com/IDLabMedia/blender-lightfield-addon.git

Here, the /path/to/blender/ is where you have blender installed, like described above. Additionally, <version> should be replaced by the version of Blender you have, e.g.: 3.0.

Option 2: Download source files and move them manually into the addon directory.

  1. Download or clone this repository.
  2. Navigate to the directory in which Blender is installed, like described above.
  3. Then continue down to where the addons are stored: ./<version>/scripts/addons. (replace <version> with the version of your Blender installation, e.g.: 3.0).
  4. Create a new directory and copy all python files from this repository to that new directory.

Usage

Open Blender and go to Edit > Preferences ... > Add-ons and search for "6D Lightfield Renderer". Make sure the addon is enabled by checking the checkbox.

Blender Addons

Settings

To start using the addon in Blender, open the 3D Viewport view and type N to open the right Sidebar. You will see a new tab there, called Lightfield.

Interface 1

Clicking the icon on the left of that opens a dropdown that allows you to select the desired camera setup. The options are: Lightfield Plane, Cuboid, Cylinder and Sphere. Selecting one creates a default camera setup of the chosen type. The setup can be configured in this Sidebar, as well as by going into the Properties tab that is by default already open on the right side of Blender and selecting the Object data properties icon .

Interface 2

Moving, rotating and scaling the camera setups can be done from the 3D Viewport. Changing the number of cameras and the camera intrinsics (resolution, focal length, etc.) is done in the Object data properties .

Rendering: in the right Sidebar of the 3D Viewport, under tab Lightfield > Output, set the desired output path. Then start the rendering process by pressing the Render Lightfield button at the top of the Sidebar. Blender will now render one image for each camera in the setup and store them in the output folder.

Image format: by default, the output images are stored as PNG files. It is possible to also store the depth maps by selecting the checkbox next to Depth (OpenEXR) in the Sidebar. This will, for each camera, combine the output image and depth into one .exr file, where the first 3 channels contain the (red, green, blue) color data, and the fourth channel the depth (by default in meters). The OpenEXR files contain 16-bit floating-point RGB and Depth. This means that the actual "bit depth" is 10-bit mantissa, with a 5-bit power value and 1-bit sign.

Camera config file: by pressing the Render Lightfield button, a lightfield.json (and a deprecated lightfield.cfg) file are created, containing information about the camera intrinsics (lens type, projection type, sensor width, resolution, etc.), the camera setup type (Plane, Cuboid, Cylinder, Sphere), and the position and rotation of each camera according to the Blender axial system (Z up, right-handed).

Compositing: this addon also works when Compositing nodes are used.

blender-lightfield-addon's People

Contributors

jlartois avatar mcourteaux avatar robbinwang00 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

blender-lightfield-addon's Issues

Update it for 3.4+๏ผŸ

May too old...3.4 3.5 can't use as normal

`Traceback (most recent call last):
  File "G:\blender\35\3.5\scripts\modules\addon_utils.py", line 369, in enable
    mod.register()
  File "G:\blenderplus\3.0\addons\blender-lightfield-addon-main\__init__.py", line 130, in register
    bpy.utils.register_class(cls)
ValueError: register_class(...): already registered as a subclass 'LightfieldVisual'

image

OSError: read-only file system while enabling the addon

I cloned the repo into the Blender addon directory, and when I clicked the checkbox to enable "6D Lightfield Renderer", I got this error
Screenshot 2023-04-10 at 4 27 00 PM

I tried setting writable permission to the blender-lightfield-addon folder with
chmod -R 777 path/to/blender-lightfield-addon
but it didn't work.
If anyone happening to read this can help me out, I'd appreciate it greatly

Lightfield Display Hardware Adaptation Test + Lightfield Plugin Installation Process Error.

Dear IDLab Media,

I am an engineer who specializes in hardware. I'm developing a hardware prototype device for a light field display. It enables 3D visual effects to be felt with the naked eye and has a wide continuous viewing angle.

My computer is an Apple Mac M1 and I'm using blender, currently version 3.6 as well as 4.0. I'm testing, against a 3D model for light field rendering to test the visual effects in my display prototype. I am honored to see your lightfield plugin.

However, I have encountered some errors during the installation process and look forward to your response. Thanks!

The errors are specified below:

Traceback (most recent call last).
File "/Applications/Blender3.6.app/Contents/Resources/3.6/scripts/modules/addon_utils.py", line 369, in enable
mod.register()
File "/Users/cdy/Library/Application Support/Blender/3.6/scripts/addons/blender-lightfield-addon-main/init.py", line 130, in register
bpy.utils.register_class(cls)
ValueError: register_class(...) : already registered as a subclass 'LightfieldVisual'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.