Blender Git Loki

Git Commits -> Revision e280c04

Revision e280c04 by swann (master)
January 17, 2020, 18:14 (GMT)
Fix lightprobe creation from python data API

### Description of the problem

Until now, it is only possible to correctly add a lightprobe in python via an operator:
`bpy.ops.object.lightprobe_add()`

### Description of the proposed solution

The idea of this patch is to fix the lack of consistency lightprobe creation without operator.
It allow creation of different lightprobe type directly via `bpy.data.lightprobes.new(name, type)` (such as for curves).

In order to make it possible I had to:
1. Add a function `BKE_lightprobe_configure` in charge of lightprobe settings configuration (avoid code redundancy)
2. Allow an object to take lightprobe datablock as data during is initialization.

### A short example of this patch usage

```
lp = bpy.data.lightprobes.new('some_name','PLANAR')

bpy.data.objects.new('toto', lp)

```

Reviewed By: fclem

Differential Revision: https://developer.blender.org/D6396

Commit Details:

Full Hash: e280c0441bd84e73c47dffb66104ed40af9ea592
Parent Commit: f185a9b
Committed By: Clément Foucault
Lines Changed: +48, -21

7 Modified Paths:

/source/blender/blenkernel/BKE_lightprobe.h (+1, -0) (Diff)
/source/blender/blenkernel/intern/lightprobe.c (+24, -0) (Diff)
/source/blender/blenkernel/intern/object.c (+2, -0) (Diff)
/source/blender/editors/object/object_add.c (+1, -20) (Diff)
/source/blender/makesrna/intern/rna_main_api.c (+10, -1) (Diff)
/source/blender/makesrna/intern/rna_object.c (+8, -0) (Diff)
/source/blender/makesrna/RNA_enum_types.h (+2, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021