supertuxkart / stk-blender

Blender 2.80 exporter
MIT License
23 stars 19 forks source link

Light distance no longer configurable in blender 2.8x+ #11

Closed Benau closed 3 years ago

Benau commented 3 years ago

We may need something like this:

# .distance property in blender 2.8+ is no longer configurable in GUI, we use the "Radius" now
# which is .shadow_soft_size in API
instancing = []
for object in bpy.context.scene.objects:
    if object.type=="LIGHT" and object["type"].upper() == "LIGHT" and not object.data.name in instancing:
        object.data.energy = object.data.energy / 100.0
        object.data.shadow_soft_size = object.data.distance
        instancing.append(object.data.name)

"Radius" in blender 2.8x is .object.data.shadow_soft_size, so we need to use it instead of .distance

blender expert is it correct?

Benau commented 3 years ago

no reply! https://github.com/supertuxkart/stk-blender/commit/592cd67bedd0d73b69cecee5fc4e6a27d892057a

RQWorldblender commented 3 years ago

no reply! 592cd67

Sorry that I wasn't able to come. From all that I saw for that issue, it should be correct, though I haven't tested it. Actually I can't be considered a Blender expert, because I haven't fully explored everything that Blender offers, since most of it is useless for STK.