Developing and debugging BlendLuxCore

From LuxCoreRender Wiki
Jump to navigation Jump to search

Introduction

Goal and audience

This document explains the approach to install a development version of BlendLuxCore (BLC) in Blender, so that it's possible to test and debug it.
The targeted audience encompasses:

  • BlendLuxCore development contributors
  • BlendLuxCore advanced users/alpha testers who have been provided a dev version of BLC, in order to test a new feature.

Statement of problem

BlendLuxCore (BLC) is in two parts:

  • Python module
  • Underlying pyluxcore library, brought by a Python wheel

In normal life, Blender loads the BLC Python module that has been regularly installed, which in turn loads the wheel from PyPi.

However, when developing BLC, we typically need to:

  • Make Blender load a development version of BLC
  • And optionally make BLC load a development version of the wheel

Those goals can be achieved via 2 environment variables:

  • BLC_DEV_PATH: path to the development version of BlendLuxCore
  • BLC_WHEEL_PATH: path to a development version of the wheel

We'll see the use of those variables through several scenarios.

Prerequisites

We assume you have set a development environment on your local computer with:

  • a cloned repository of BlendLuxCore
  • and optionally a cloned repository of LuxCore


We also assume you know how to "pack" BlendLuxCore, ie build an installable package of BLC:

cmake -S . -B out -DCMAKE_BUILD_TYPE=Release
cmake --build out

Scenario #1: Working on BLC, using standard pyluxcore

In the environment where you run Blender, set BLC_DEV_PATH to the path of your dev repository:

  • export BLC_DEV_PATH=/path/to/BlendLuxCore.

Pack BLC, run Blender and install your packed version

Scenario #2: Working on pyluxcore

<WORK IN PROGRESS>

Useful information

The extension is installed in:
$HOME/.config/blender/<blender-version>/extensions/user_default

The wheel is installed in:
$HOME/.config/blender/<blender version>/extensions/.local/lib/python<python-version>/site-packages