/blender-pcd-io

Import and Export Point Cloud Data files from Blender 2.8+

Primary LanguagePython

blender-pcd-io

Add-on for importing and exporting PCD files from Blender 2.8+.

Features:

  • No external dependencies. Although, python-lzf will be used, if installed, when importing compressed pointclouds.
  • Point-clouds are editable using Blender's standard modelling tools.
  • Supports importing of PCD files in ascii, binary, and binary_compressed formats.

Missing Features:

  • No support for coloured point-clouds (due to use of Blender mesh verticies).
  • No support for labelled point-clouds.
  • Exports PCD files as binary encoded, and currently has no option to select other export formats.

Installation

Download the latest zip archive (pcd-io.zip) from the releases page.

Open Blender and navigate to:

Edit -> Preferences -> Add-ons -> Install

When prompted select the zip file pcd-io.zip. Afterwards you will see a screen like in the following image.

NOTE: You must enable the plugin by clicking the box shown in the screenshot before you can use it!

Usage

After installing this plugin, there are two ways to import and export PCD files.

1. Import/Export from the user interface

You can import and export PCD files from the File menu (shown in first screenshot):

File -> Import -> Point Cloud Data (.pcd)

File -> Export -> Point Cloud Data (.pcd)

2. Import/Export programatically

You can also import and export PCD files programatically. For example:

bpy.ops.import_mesh.pcd(filepath="/home/username/pointcloud_to_import.pcd")
bpy.ops.export_mesh.pcd(filepath="/home/username/output_pointcloud.pcd")

Tips:

  1. When exporting, ensure you have selected the items you wish to export. If no objects are selected in Blender, nothing will be exported and you may see an error.
  2. When exporting a pointcloud after making edits, make sure to exit the Edit Mode context (e.g. return to Object Mode context) otherwise your changes may not be reflected in the output file.
  3. If you have trouble with paths not being found when importing/exporting, try using an absolute path and without path expansion. For example: /home/username/thing.pcd, rather than ~/thing.pcd.